<?php global $wp_registered_sidebars;
for($i=1;$i<count($wp_registered_sidebars)+1;$i++){
?>
  <div id="sidebar<?php echo $i ?>" class="sidebar">
    <ul class="sidebar-wrapper">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar($i) ) : // begin primary sidebar widgets ?>
      <li class="widget textwidget">
        <h3 class="widgettitle"><?php _e( 'Pages', 'sandbox' ) ?></h3>
        <p>This is Sidebar <?php echo $i ?>.</p>
      </li>
<?php endif; // end primary sidebar widgets  ?>
    </ul>
  </div><!-- #sidebar<?php echo $i ?> .sidebar -->
<?php } ?>